Auto merge of #3144 - alexcrichton:less-update-registry, r=brson
authorbors <bors@rust-lang.org>
Wed, 5 Oct 2016 23:22:25 +0000 (16:22 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2016 23:22:25 +0000 (16:22 -0700)
Avoid updating registry when adding existing deps

Cargo previously erroneously updated the registry whenever a new dependency was
added on a crate which already exists in the DAG. This commit fixes this
behavior by ensuring that if the new dependency matches a previously locked
version it uses that instead.

This commit involved a bit of refactoring around this logic to be a bit more
clear how the locking and "falling back to the registry" is happening.

Closes #2895


Trivial merge